package com.sky.mapper;

import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {

    List<ShoppingCart> list(ShoppingCart shoppingCart);
    @Update("update shopping_cart set number = #{number} where id = #{id}")
    void updateNumberById(ShoppingCart shoppingCart1);
    @Insert("insert into shopping_cart (name, image, amount, number, dish_id, setmeal_id, user_id, create_time,dish_flavor) " +
            "values (#{name}, #{image}, #{amount}, #{number}, #{dishId}, #{setmealId}, #{userId}, #{createTime},#{dishFlavor})")
    void insert(ShoppingCart shoppingCart);
    @Delete("delete from shopping_cart where user_id = #{userId}")
    void deleteAll(Long userId);
    @Delete("delete from shopping_cart where id = #{id}")
    void deleteDishByid(Long id);

    void insertBatch(List<ShoppingCart> shoppingCartList);
}
